Arrays in CPP

 Arrays

 An array is a group of related data items that share a common name

 To Use Arrays

            Declare a variable

       Store the values

       access the values

 

Example 01:

# include <iostream.h>

void main()

{

            int a[10]; //declaration

            for (int i=0;i<10;i++) //storing the values

             cin>>a[i];

 

            for (int i=0;i<10;i++) // printing the values

             cout<<a[i];

}

← Back Next →

Comments

Popular posts from this blog

Wrapper Class

Information Security & Essential Terminology

Information Security Threat Categories